package com.naodong.shenluntiku.mvp.model.error;

import io.reactivex.observers.DisposableObserver;


/**
 * Created by jess on 9/2/16 14:41
 */

public abstract class ResultHandleSubscriber<T> extends DisposableObserver<T> {

    ResponseErrorListener erroListener;

    public ResultHandleSubscriber(ResponseErrorListener erroListener) {
        this.erroListener = erroListener;
    }

    @Override
    public void onComplete() {

    }

    @Override
    public void onError(Throwable e) {
        erroListener.handleResponseError(RxNetErrorProcessor.tryWithApiError(e));
    }

}

